home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 22
/
Amiga Format AFCD22 (Jan 1998, Issue 106).iso
/
-in_the_mag-
/
converters
/
graphics
/
netpbm
/
pbmrexx
/
rexx
/
pnmsmooth.rexx
< prev
Wrap
OS/2 REXX Batch file
|
1997-11-16
|
2KB
|
69 lines
/* pnmsmooth - smooth out an image by replacing each xel with the
* average of its nine immediate neighbors
*
* Copyright (C) 1994 by Ingo Wilken (Ingo.Wilken@informatik.uni-oldenburg.de)
* Based on pnmsmooth (sh-script) by Jef Poskanzer
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation. This software is provided "as is" without express or
* implied warranty.
*
* $VER: pnmsmooth 1.1
*/
parse source junk junk progname junk
address command
signal on error
signal on break_c
signal on break_d
signal on ioerr
signal on halt
ID = pragma('Id')
if ~open(err, "CONSOLE:", 'W') then exit 20
parse arg first tail
if abbrev(first, '-', 1) then call usage
if tail ~= '' then call usage
tmp = 'T:psm.'ID
call rm tmp
if ~open(out, tmp, 'W') then exit 20
call writeln out, P2
call writeln out, 3 3
call writeln out, 18
call writeln out, 10 10 10
call writeln out, 10 10 10
call writeln out, 10 10 10
call writeln out, 10 10 10
call close out
'pnmconvol' tmp first
call rm tmp
exit 0
usage:
call writeln err, 'usage:' progname '[pnmfile]'
exit 10
rm: procedure
arg name
signal off error /* ignore WARN */
'delete' name 'quiet force >NIL:'
signal on error
return
error:
ioerr:
halt:
call writeln err, progname ': error at line' SIGL 'code' RC
break_c:
break_d:
call rm tmp
exit 20